package com.glela.es.util;

import java.util.ArrayList;
import java.util.List;

import com.alibaba.fastjson.JSONObject;

public class DataFactory {

	public static DataFactory dataFactory = new DataFactory();

	private DataFactory() {

	}

	public DataFactory getInstance() {
		return dataFactory;
	}

	public static <T> List<String> toJsonData(List<T> inputList) {
		List<String> list = null;
		if (inputList != null && inputList.size() > 0) {
			list = new ArrayList<String>();
			for (T obj : inputList) {
				String data = JSONObject.toJSONString(obj);
				list.add(data);
			}
		}
		return list;
	}
}
